// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MoveAndGraspTaskDescription.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Microsoft.Robotics.Manipulation.PicknPlace
{
    using System;
    using System.Runtime.Serialization;
    using Microsoft.Robotics.Numerics;

    /// <summary>
    /// Description of a move and grasp task. A pick or place action is a sequence of Move and Grasp tasks (sometimes
    /// also referred to as move and grasp steps) This description generally refers to the target state of the tool control
    /// point and gripper at the end of a move and grasp step.
    /// </summary>
    public class MoveAndGraspTaskDescription
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MoveAndGraspTaskDescription" /> class
        /// </summary>
        /// <param name="armPose">Pose of arm at end of sub task</param>
        /// <param name="picknPlaceStatus">Which phase of overall pick and place this sub task belongs</param>
        /// <param name="gripperState">State of the gripper</param>
        /// <param name="description">Text description of the sub task</param>
        /// <param name="delayInMsec">Time in mSec to wait when the sub task completes</param>
        public MoveAndGraspTaskDescription(
            Pose armPose,
            PicknPlaceStatusEnum picknPlaceStatus,
            GripperStatus gripperState,
            string description,
            int delayInMsec)
        {
            this.ArmPose = armPose;
            this.PicknPlaceStatus = picknPlaceStatus;
            this.GripperState = gripperState;
            this.DelayInMsec = delayInMsec;
            this.Description = description;
        }

        /// <summary>
        /// Gets the desired pose for the arm at the end of the sub task
        /// </summary>
        public Pose ArmPose { get; private set; }

        /// <summary>
        /// Gets a value describing the the phase of the overall pick and place task
        /// during this move and grasp
        /// </summary>
        public PicknPlaceStatusEnum PicknPlaceStatus { get; private set; }

        /// <summary>
        /// Gets the desired state of the gripper at the end of the sub task
        /// </summary>
        public GripperStatus GripperState { get; private set; }

        /// <summary>
        /// Gets the human readable description of the sub task
        /// </summary>
        public string Description { get; private set; }

        /// <summary>
        /// Gets the time expressed in mSec to wait at after the move and grasp has completed before declaring
        /// the sub task as satisfied
        /// </summary>
        public int DelayInMsec { get; private set; }
    }
}
